JBoss Community Archive (Read Only)

Teiid 8.10

OData Translator

The OData translator, known by the type name "odata" exposes the OData V2 and V3 data sources and uses the Teiid WS resource adapter for making web service calls. This translator is extension of Web Services Translator.

What is Odata

The Open Data Protocol (OData) Web protocol is for querying and updating data that provides a way to unlock your data and free it from silos that exist in applications today. OData does this by applying and building upon Web technologies such as HTTP, Atom Publishing Protocol (AtomPub) and JSON to provide access to information from a variety of applications, services, and stores. OData is being used to expose and access information from a variety of sources including, but not limited to, relational databases, file systems, content management systems and traditional Web sites.

Using this specification from OASIS group, with the help from the OData4J framework, Teiid maps OData entities into relational schema. Teiid supports reading of CSDL (Conceptual Schema Definition Language) from the OData endpoint provided and converts the OData schema into relational schema. The below table shows the mapping selections in OData Translator from CSDL document

OData

Mapped to Relational Entity

EntitySet

Table

FunctionImport

Procedure

AssosiationSet

Foreign Keys on the Table*

ComplexType

ignored**

* A Many to Many association will result in a link table that can not be selected from, but can be used for join purposes.
** When used in Functions, an implicit table is exposed. When used to define a embedded table, all the columns will be in-lined

All CRUD operations will be appropriately mapped to the resulting entity based on the SQL submitted to the OData translator.

Usage

Usage of a OData source is similar a JDBC translator. The metadata import is supported through the translator, once the metadata is imported from source system and exposed in relational terms, then this source can be queried as if the EntitySets and Function Imports were local to the Teiid system.

Execution Properties

Name

Description

Default

DatabaseTimeZone

The time zone of the database. Used when fetchings date, time, or timestamp values

The system default time zone

SupportsOdataCount

Supports $count

true

SupportsOdataFilter

Supports $filter

true

SupportsOdataOrderBy

Supports $orderby

true

SupportsOdataSkip

Supports $skip

true

SupportsOdataTop

Supports $top

true

Importer Properties

Name

Description

Default

schemaNamespace

Namespace of the schema to import

null

entityContainer

Entity Container Name to import

default container

Example importer settings to only import tables and views from NetflixCatalog.

<property name="importer.schemaNamespace" value="System.Data.Objects"/>
<property name="importer.schemaPattern" value="NetflixCatalog"/>
OData Server is not fully compatible

Sometimes it's possible that the odata server you are querying does not fully implement all OData specification features. If your OData implementation does not support a certain feature, then turn off the corresponding capability using "execution Properties", so that Teiid will not pushdown invalid queries to the translator. For example, to turn off $filter you add following to your vdb.xml

    <translator name="odata-override" type="odata">
	<property name="SupportsOdataFilter" value="false"/>
    </translator>

then use "odata-override" as the translator name on your source model.

Native Queries

Native or direct query execution is not supported through OData translator. However, user can use Web Services Translator's invokehttp method directly to issue a Rest based call and parse results using SQLXML.

Want to use as Server?

Teiid can not only consume OData based data sources, but it can expose any data source as an Odata based webservice. For more information see OData Support.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 12:15:25 UTC, last content change 2014-02-06 18:17:25 UTC.